"""
python中的内置方法称为：魔术方法
1、__init__  构造方法
2、__str__   字符串方法
3、__lt__    小于、大于符号比较
4、__le__    小于等于、大于等于符号比较
5、__eq__    ==符号比较
"""

class Student:

    def __init__(self, name, age,tel):
        self.name = name
        self.age = age
        self.tel = tel

    # 字符串
    def __str__(self):
        return f"Student {self.name}, age: {self.age}, tel: {self.tel}"

    # 小于比较
    def __lt__(self, other):
        return self.age < other.age

    # 小于等于比较
    def __le__(self, other):
        return self.age <= other.age

    # ==比较
    def __eq__(self, other):
        return self.age == other.age


stiu1 = Student("asdas",23,1777753622)
stiu2 = Student("asdas",28,1777753622)
print(stiu1)
print(stiu1>stiu2)
print(stiu1<stiu2)